-
Notifications
You must be signed in to change notification settings - Fork 512
Bump @chainlink/contracts to v1.5.0 + Add remapping support #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump @chainlink/contracts to v1.5.0 + Add remapping support #199
Conversation
The recent release of [email protected] unvendors a number of contracts. 1.5.0 utilizes remappings to resolve the import paths for these dependency packages. - Upgraded to @chainlink/[email protected] - Added helper js file to handle remappings using hardhat-preprocessor - Added remappings.txt that contains remappings - Updated hardhat.config.js to include remapping preprocessor
- Updated README to include remapping section, warning of third party plugin, and a link to the HH3 branch - Updated remappings.txt to specify the node_modules directory for each remapping. This is not required as hardhat 2 searched the node_modules directory for external libraries by default. However, including it allows developers to better understand exactly what is happeng (or where the remapping is going to).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Note: I've pushed a small commit on top of your branch to improve alerting for end users to the remapping concept.
Also minor comment on version pinning in package.json
Pinned @chainlink/[email protected]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Summary
This PR modernizes the Hardhat 2 starter kit to work with the unvendored layout in
@chainlink/[email protected]
and documents a way to use Solidity import remappings in HH2 viahardhat-preprocessor
.What changed
@chainlink/contracts
to v1.5.0hardhat-preprocessor
and a small helper to rewrite Solidity imports based on aremappings.txt
. Wire it intohardhat.config.js
viapreprocess
.[email protected]
(e.g.,vrf/VRFCoordinatorV2_5.abi.json
,shared/LinkToken.abi.json
).hardhat-preprocessor
, and a warning that it’s a third-party plugin.remappings.txt
more explicit by pointing each alias to itsnode_modules
location (clearer for newcomers even though HH2 already searchesnode_modules
).remappings-helper.js
to explain how the loader and preprocessor hook work.Why
@chainlink/[email protected]
un-vendors several packages and changes import locations; without remapping, HH2 users hit broken imports or long relative paths. Remapping keeps imports clean & resilient.